package com.test.swagger;


import com.test.util.IpKit;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Author: dong peng
 * Date: 2018/1/23
 * Time: 17:31
 */


@Controller
public class SwaggerApi {

    @RequestMapping(value="/name/{name}", method = RequestMethod.GET)
    @ApiOperation(value = "根据用户名获取用户对象", httpMethod = "GET", response = ApiResult.class, notes = "根据用户名获取用户对象")
    public @ResponseBody ApiResult test(@ApiParam(required = true, name = "name", value = "用户名") @PathVariable String name) {
        ApiResult apiResult = new ApiResult();
        apiResult.setMsg("hello "+name);
        return apiResult;
    }

}
